package com.bolt.report.engine.model;

import com.bolt.report.definition.StyleDefinition;
import com.bolt.report.engine.FillElement;
import com.bolt.report.engine.FillElementVisitor;
import org.apache.poi.ss.formula.functions.T;

import java.io.Serializable;

public class Cell implements Serializable, Cloneable {

    private StyleDefinition style;

    private FillElement element;

    private int columnIndex;

    private int rowIndex;

    private int colSpan;

    private int rowSpan;


    public Cell(int rowIndex, int columnIndex, FillElement element) {
        this.rowIndex = rowIndex;
        this.columnIndex = columnIndex;
        this.element = element;
    }


    public FillElement getElement() {
        return element;
    }

    public StyleDefinition getStyle() {
        return style;
    }

    public void setStyle(StyleDefinition style) {
        this.style = style;
    }

    public void setElement(FillElement element) {
        this.element = element;
    }

    public int getColumnIndex() {
        return columnIndex;
    }

    public void setColumnIndex(int columnIndex) {
        this.columnIndex = columnIndex;
    }

    public int getRowIndex() {
        return rowIndex;
    }

    public void setRowIndex(int rowIndex) {
        this.rowIndex = rowIndex;
    }

    public int getColSpan() {
        return colSpan;
    }

    public void setColSpan(int colSpan) {
        this.colSpan = colSpan;
    }

    public int getRowSpan() {
        return rowSpan;
    }

    public void setRowSpan(int rowSpan) {
        this.rowSpan = rowSpan;
    }

    public void accept(FillElementVisitor<T> visitor) {
        element.accept(visitor, this);
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }


}
